package com.xxq.aidlserver;

import android.os.Parcel;
import android.os.Parcelable;

public class NewsInfo implements Parcelable {
    private String newsTitle;
    private String newsUrl;
    private String newsTime;

    public NewsInfo() {
    }

    public NewsInfo(String newsTitle, String newsTime) {
        this.newsTitle = newsTitle;
        this.newsTime = newsTime;
    }

    public NewsInfo(String newsTitle, String newsUrl, String newsTime) {
        this.newsTitle = newsTitle;
        this.newsUrl = newsUrl;
        this.newsTime = newsTime;
    }

    protected NewsInfo(Parcel in) {
        this.newsTitle = in.readString();
        this.newsUrl = in.readString();
        this.newsTime = in.readString();
    }

    public String getNewsTitle() {
        return newsTitle;
    }
    public String getNewsTime() {
        return newsTime;
    }
    public String getNewsUrl() {
        return newsUrl;
    }

    public void setNewsTitle(String newsTitle) {
        this.newsTitle = newsTitle;
    }
    public void setNewsTime(String newsTime) {
        this.newsTime = newsTime;
    }
    public void setNewsUrl(String newsUrl) {
        this.newsUrl = newsUrl;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(newsTitle);
        dest.writeString(newsUrl);
        dest.writeString(newsTime);
    }

    public static final Creator<NewsInfo> CREATOR = new Creator<NewsInfo>() {
        @Override
        public NewsInfo createFromParcel(Parcel in) {
            //从Parcel中读取数据,返回NewsInfo对象
            return new NewsInfo(in);
        }

        @Override
        public NewsInfo[] newArray(int size) {
            return new NewsInfo[size];
        }
    };
}
